#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include "pirateAcorn.h"

int main() {
  int fd;
  char buf[10];
  int pid;
  printf("Please enter the PID of the thread you want to exclusivly monitor\n");
  if ((fd = open ("/dev/pirateAcorn0", O_WRONLY)) == -1) {
    perror("error opening file");
    return -1;
  }
  fgets(buf,9,stdin);
  pid=atoi(buf);
  if (pid>0) {
    ioctl(fd,PA_IOCLOGPID,pid);
  }  
  close(fd);
  return 0;
}
